<template>
  <!--
   * @FileDescription: 404
   * @author Sun Yan
   * @Date $
  -->
  <div class="not-found-container">
    <img src="../../assets/images/2140_list.jpg" alt="">
    <p>{{ timeText }}秒后自动，返回首页</p>
  </div>
</template>
<script>
/**
 * @description: 方法描述
 * @param {参数类型} 参数名称
 * @param {参数类型} 参数名称
 * @return void
 */
var notFound = null;
export default {
  name: "not-found",
  data() {
    return {
      timeText: 5,
    }
  },

  beforeDestroy() {
    window.clearInterval(notFound);
  },
  created() {
    notFound = window.setInterval(_ => {
      this.timeText -= 1;
      if(this.timeText <= 0) {
        window.clearInterval(notFound);
        this.$router.push({
          path: '/'
        })
      }
    }, 1000)
  },

  methods: {}
}
</script>

<style lang="scss">
.not-found-container {
  img {
    display: block;
    width: 60vw;
    height: auto;
    margin: 100px auto 20px;
  }
  p {
    text-align: center;
  }
}
</style>